home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Carousel
/
CAROUSEL.cdr
/
mactosh
/
util
/
hdrunner.sit
/
Launch HD Runner.c
< prev
next >
Wrap
Text File
|
1987-04-14
|
1KB
|
51 lines
/*
* A stub application that can live on the desktop and invoke "HD Runner" in the system folder.
* Done this way instead of Oasis's document dodge so that it can be found in Transfer menus.
* It only beeps on errors because we don't want to initialize the mess of managers necessary
* to complain properly. Besides, this should be small.
*/
#include <FileMgr.h>
#include <HFS.h>
#define NULL 0L
#define R_RUNNER 128 /* ID of "HD Runner" string */
main()
{
HParamBlockRec myHPB;
WDPBRec myWDPB;
register StringHandle HDRunner;
if ( (HDRunner = (StringHandle)GetResource('STR ', R_RUNNER)) == NULL) {
SysBeep(5);
ExitToShell();
}
if (FSFCBLen > 0) { /* Running HFS */
myHPB.volumeParam.ioCompletion = NULL;
myHPB.volumeParam.ioVRefNum = 0; /* default volume */
myHPB.volumeParam.ioNamePtr = NULL;
myHPB.volumeParam.ioVolIndex = 0; /* not indexed call */
if (PBHGetVInfo(&myHPB, FALSE) != noErr) {
SysBeep(6);
ExitToShell();
}
/* SetVol to the blessed folder */
myWDPB.ioCompletion = NULL;
myWDPB.ioNamePtr = NULL;
myWDPB.ioVRefNum = 0; /* default volume */
myWDPB.ioWDDirID = myHPB.volumeParam.ioVFndrInfo[1];
if (PBHSetVol(&myWDPB, FALSE) != noErr) {
SysBeep(7);
ExitToShell();
}
}
Launch(0, *HDRunner);
}